<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    body,html{height:100%;}
    .box{
      border:1px solid red;
    }
    .box div{
      height:300px;
      border:3px solid;
    }
  </style>
</head>
<body>
  <div class="box">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <button id="back">Back</button>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </div>
</body>
<script>
  window.onload=function(){
    document.body.scrollTop = '100px'
  }
  var back = document.getElementById('back');
  window.onscroll=function(){
    console.log(document.documentElement.scrollTop)
  }
  back.onclick=function(){
    console.log(this.offsetTop)
    window.scrollTo(0,this.offsetTop)
  }
</script>
</html>